﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using WebPic.Sample.Modelo.Entidades;

namespace WebPic.Sample.Modelo.Mappings
{
    internal class VendaMapping : EntityTypeConfiguration<Venda>
    {
        public VendaMapping()
        {
            HasRequired(v => v.Pessoa)
                .WithMany(p => p.Vendas)
                .HasForeignKey(v => v.IdPessoa);

            HasRequired(v => v.TabelaPreco)
                .WithMany(t => t.Vendas)
                .HasForeignKey(v => v.IdTabelaPreco);
        }
    }
}
